# -*- coding: utf-8 -*-
import cPickle

a = 123, 'abc', [5,6], {'key': 'value'}
print a

#保存
f = open('save.txt','w')
cPickle.dump(a, f)
f.close()

#读取
g = open('save.txt')
b = cPickle.load(g)
print b

#保存到内存
c = cPickle.dumps(a)
print c

#读取
d = cPickle.loads(c)
print d
